#ifndef __UTIL_H
#define __UTIL_H

#include <stdio.h>
#include <string.h>

#define FAILED -1

// #define __DEBUG__
#define filename(x) strrchr(x,'/')?strrchr(x,'/')+1:x
#ifdef __DEBUG__
#define debug_printf(format, ...) \
        printf("[file: %s, line: %d] " format, filename(__FILE__), __LINE__, ##__VA_ARGS__)
#else
#define debug_printf(format, ...)
#endif

#define err_printf(format, ...) \
        printf("[file: %s, line: %d] " format, filename(__FILE__), __LINE__, ##__VA_ARGS__)



void destroy_mem(void *src);



#endif